package com.scraper.dao.hibernate;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.scraper.dao.RegionDAO;
import com.scraper.model.Region;

public class RegionDAOImpl extends BaseDAOImpl<Region> implements RegionDAO {

	public RegionDAOImpl() {
		super(Region.class);
	}

	public Region getByName(String name) {
		Criteria criteria = getSession().createCriteria(entityClass);
		criteria.add(Restrictions.eq("name", name));
		return (Region) criteria.uniqueResult();
	}

}
